package com.spike.common;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class R<T> {
    private Integer code;
    private String message;
    private T data;

    public R(int code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public static <T>R<T> succeed() {
        return new R<T>(200,"成功");
    }
    public static <T>R<T> succeed(T data) {
        return new R<T>(200,"成功",data);
    }
}
